package org.nfIt.anno;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import org.nfIt.validation.StateValidation;

import java.lang.annotation.*;

/**
 * ClossName:State
 * Pakage:org.nfIt.anno
 * Description
 *
 * @Author L
 * @Create 2024/6/6 8:48
 * @Version 2023.1.3
 */
@Documented
@Target( ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)

@Constraint(validatedBy = {StateValidation.class})//谁给这个注解类提供校验资格

public @interface State {
    //提供校验失败后的提示信息
    String message() default "state参数的值只能是已发布或者草稿";
    //指定分组
    Class<?>[] groups() default {};
    //负载 获取到State注解的附加信息
    Class<? extends Payload>[] payload() default {};
}
